<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="init.jsp"%>

<ts:pageTemplate>
	<div class="container-fluid">
		<div class="row-fluid">
			<div class="span12">
				<table class="table table-hover table-bordered">
					<thead>
						<tr>
							<th>#</th>
							<th>Title</th>
							<th>Action</th>
						</tr>
					</thead>
					<tbody>
						<c:forEach var="test" items="${tests}" varStatus="status">
							<tr id="${test.id}">
								<td class="row">${status.index+1}</td>
								<td class="row"><a>${test.title}</a></td>
						
								<td class="row">
									<div class="btn-group">
										<form action="/FaTestingSystem/testAction" method="get">
											<a
												href="<c:url value="/exploreSingleTest?testId=${test.id}" />">
												<button class="btn pull-left btn-1" name="action"
													type="button" value="/exploreSingleTest?testId=${test.id}">Take
													a test</button>
											</a>
											<c:choose>
											<c:when test="${role=='[ROLE_ADMIN]'}">
											<button class="btn pull-left btn-1" name="action"
												type="submit" value="editTest_${test.id}">Edit</button>
											<button class="btn pull-right btn-2" name="action"
												type="submit" value="deleteTest_${test.id}">Delete</button>
												</c:when>
												</c:choose>
										</form>
									</div>
								</td>
							</tr>
						</c:forEach>
					</tbody>
				</table>
			</div>
		</div>
	</div>
</ts:pageTemplate>











